package com.example.demo_1106.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 用户表
 * @TableName userinfo
 */
@TableName(value ="userinfo")
@Data
public class Userinfo implements Serializable {
    /**
     * 用户ID
     */
    @TableId(type = IdType.AUTO)
    private Integer userid;

    /**
     * 用户中文名字
     */
    private String username;

    /**
     * 用户登录名
     */
    private String userloginname;

    /**
     * 用户密码
     */
    private String userpass;

    /**
     * 用户邮件
     */
    private String usermail;

    /**
     * 电话
     */
    private String userphone;

    /**
     * 状态：1启用0禁用
     */
    private String userused;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Userinfo other = (Userinfo) that;
        return (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
            && (this.getUserloginname() == null ? other.getUserloginname() == null : this.getUserloginname().equals(other.getUserloginname()))
            && (this.getUserpass() == null ? other.getUserpass() == null : this.getUserpass().equals(other.getUserpass()))
            && (this.getUsermail() == null ? other.getUsermail() == null : this.getUsermail().equals(other.getUsermail()))
            && (this.getUserphone() == null ? other.getUserphone() == null : this.getUserphone().equals(other.getUserphone()))
            && (this.getUserused() == null ? other.getUserused() == null : this.getUserused().equals(other.getUserused()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
        result = prime * result + ((getUserloginname() == null) ? 0 : getUserloginname().hashCode());
        result = prime * result + ((getUserpass() == null) ? 0 : getUserpass().hashCode());
        result = prime * result + ((getUsermail() == null) ? 0 : getUsermail().hashCode());
        result = prime * result + ((getUserphone() == null) ? 0 : getUserphone().hashCode());
        result = prime * result + ((getUserused() == null) ? 0 : getUserused().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userid=").append(userid);
        sb.append(", username=").append(username);
        sb.append(", userloginname=").append(userloginname);
        sb.append(", userpass=").append(userpass);
        sb.append(", usermail=").append(usermail);
        sb.append(", userphone=").append(userphone);
        sb.append(", userused=").append(userused);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}